import $ from '@/http'

// 新增日程
const addSchedule = data => {
  return $.jsonPost('cse/schedule/management/addSchedule', data)
}

// 日程列表
const queryCurrentUserAllScheduleByOrganizer = data => {
  return $.jsonPost(
    'cse/schedule/management/queryCurrentUserAllScheduleByOrganizer',
    data
  )
}

// 日程
const deleteSchedule = data => {
  return $.jsonPost('cse/schedule/management/deleteSchedule', data)
}

// 修改日程
const editSchedule = data => {
  return $.jsonPost('cse/schedule/management/editSchedule', data)
}

//  /cse/sso/sso/deptUserTree

const deptUserTree = data => {
  return $.jsonPost('cse/schedule/sso/deptUserTree', data)
}

// /cse/schedule/management/queryOrganizerWithCurrentUser 查询当前登录用户参与的所有日程的组织者信息
const queryOrganizerWithCurrentUser = data => {
  return $.jsonPost(
    'cse/schedule/management/queryOrganizerWithCurrentUser',
    data
  )
}

// cse/schedule/management/queryCurrentUserScheduleWithin30Days 查询当前登录用户30天内的日程
const queryCurrentUserScheduleWithin30Days = data => {
  return $.jsonPost(
    'cse/schedule/management/queryCurrentUserScheduleWithin30Days',
    data
  )
}

const getwils = data => {
  return $.jsonPost('wils/wopi/pv', data)
}
export default {
  addSchedule,
  queryCurrentUserAllScheduleByOrganizer,
  deleteSchedule,
  editSchedule,
  deptUserTree,
  queryOrganizerWithCurrentUser,
  queryCurrentUserScheduleWithin30Days,
  getwils
}
